﻿
using UnityEngine;

public class PlayerMana : MonoBehaviour
{
	[Header("Config")]
	[SerializeField] private PlayerStats stats;

	
	private void Update()
	{
		if (Input.GetKeyDown(KeyCode.M))
		{
			UseMana(1f);
		}
	}
	
	public void UseMana(float amount)
	{
		if (stats.mana >= amount)
		{
			//stats.mana -= amount;
			stats.mana = Mathf.Max(stats.mana - amount, 0f);
		}
		
	}
}
